summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWollnashorn <Wollnashorn@users.noreply.github.com>2023-01-03 04:18:45 +0100
committerWollnashorn <Wollnashorn@users.noreply.github.com>2023-01-05 21:03:01 +0100
commit9c9008ac813161bfbb6489ee128199e27c9515f7 (patch)
treed9acfe3e14bc5bb16326c1f36bd4dd715a57a43a
parentconfig: Set the Vulkan driver pipeline cache option to be global (diff)
downloadyuzu-9c9008ac813161bfbb6489ee128199e27c9515f7.tar
yuzu-9c9008ac813161bfbb6489ee128199e27c9515f7.tar.gz
yuzu-9c9008ac813161bfbb6489ee128199e27c9515f7.tar.bz2
yuzu-9c9008ac813161bfbb6489ee128199e27c9515f7.tar.lz
yuzu-9c9008ac813161bfbb6489ee128199e27c9515f7.tar.xz
yuzu-9c9008ac813161bfbb6489ee128199e27c9515f7.tar.zst
yuzu-9c9008ac813161bfbb6489ee128199e27c9515f7.zip
-rw-r--r--src/yuzu/main.cpp20
-rw-r--r--src/yuzu/main.h1
2 files changed, 20 insertions, 1 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 524650144..c55f81c2f 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -2229,8 +2229,10 @@ void GMainWindow::OnGameListRemoveFile(u64 program_id, GameListRemoveTarget targ
}
switch (target) {
- case GameListRemoveTarget::GlShaderCache:
case GameListRemoveTarget::VkShaderCache:
+ RemoveVulkanDriverPipelineCache(program_id);
+ [[fallthrough]];
+ case GameListRemoveTarget::GlShaderCache:
RemoveTransferableShaderCache(program_id, target);
break;
case GameListRemoveTarget::AllShaderCache:
@@ -2271,6 +2273,22 @@ void GMainWindow::RemoveTransferableShaderCache(u64 program_id, GameListRemoveTa
}
}
+void GMainWindow::RemoveVulkanDriverPipelineCache(u64 program_id) {
+ static constexpr std::string_view target_file_name = "vulkan_pipelines.bin";
+
+ const auto shader_cache_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir);
+ const auto shader_cache_folder_path = shader_cache_dir / fmt::format("{:016x}", program_id);
+ const auto target_file = shader_cache_folder_path / target_file_name;
+
+ if (!Common::FS::Exists(target_file)) {
+ return;
+ }
+ if (!Common::FS::RemoveFile(target_file)) {
+ QMessageBox::warning(this, tr("Error Removing Vulkan Driver Pipeline Cache"),
+ tr("Failed to remove the driver pipeline cache."));
+ }
+}
+
void GMainWindow::RemoveAllTransferableShaderCaches(u64 program_id) {
const auto shader_cache_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ShaderDir);
const auto program_shader_cache_dir = shader_cache_dir / fmt::format("{:016x}", program_id);
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index db318485d..f25ce65a8 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -347,6 +347,7 @@ private:
void RemoveUpdateContent(u64 program_id, InstalledEntryType type);
void RemoveAddOnContent(u64 program_id, InstalledEntryType type);
void RemoveTransferableShaderCache(u64 program_id, GameListRemoveTarget target);
+ void RemoveVulkanDriverPipelineCache(u64 program_id);
void RemoveAllTransferableShaderCaches(u64 program_id);
void RemoveCustomConfiguration(u64 program_id, const std::string& game_path);
std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id);